<%--
  Created by IntelliJ IDEA.
  User: lirance
  Date: 15/5/16
  Time: 下午4:59
  To change this template use File | Settings | File Templates.
  创建房间
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<head>
    <title>创建房间</title>
    <link rel="stylesheet" href="css/createRoom.css">
    <style type="text/css">

        a:link {

            text-decoration:none;
        }
        a:visited {

            text-decoration:none;
        }
        a:hover {

            text-decoration:underline;
        }
        a:active {

            text-decoration:none;
        }
    </style>
</head>
<br>
<script type="text/javascript">

    function create(form) {
        var user = "${sessionScope.user.username}";
        if (user == "") {
            if (confirm("用户未登录，请返回登录")) {
                location.href = "login.jsp";

            }
            else
                location.href = "login.jsp";
            return false;
        }
        if (form.roomname.value == "") {
            alert("房间名不能为空！");
            return false;
        }
        if (form.membernum.value == "") {
            alert("房间人数不能为空！");
            return false;
        }
        if (form.roomtype.value == "") {
            alert("房间类型不能为空！");
            return false;
        }

    }
</script>



<body>
<div id="head">


    <img id="logo-style" src="images/logomini.png" width="70" height="70" />
    <span  id="headstyle"> Drrr chat room</span>
    <div class="navigation">
        <a href="userProfile.jsp"><img id="touxiang-position" src="images/TouXiang/1.png" width="45" height="45"/></a>
        <span id="usernamestyle" >${sessionScope.user.username}</span>
        <span id="span-style">|</span>
        <a href="login.jsp"><span id="spanexitstyle">exit</span></a>
    </div>

</div>


<div id="text" >
    <div class="creamroom-frm">




        <s:form name="createChatRoomForm" action="createRoom" method="POST" onsubmit="return create(this)">
            <div id="buju">
                <div  class="label-na-num">
                    <s:label  for="roomname" value="房名"/>
                    <input name="roomname" type="text" />
                </div>
                <div class="label-na-num1">
                    <label  for="membernum">房间人数</label>
                    <s:select name="membernum" label="房间人数(2-10)" list="{'2','3','4','5','6','7','8','9','10'}">
                    </s:select><br/><br/><br/>
                </div>
                <div class="label-na-num2">
                    <label for="roomtype">房间类型</label>

                    <div class="radio-style">

                        <s:radio class="radio" name="roomtype" label="房间类型" value="1" list="#{'1':'长期','2':'临时'}"></s:radio>
                    </div>
                </div>
                <button class="button" type="submit">创建</button>
                <button class="button2" type="reset">撤销</button>
            </div>
        </s:form>



    </div>


</div>





</body>
</html>
